import React, { Component } from 'react';
import { Modal } from 'antd';

class CashierModal extends Component {
  render() {
    const { title, onCancel, onOk, children, visible, width, footer } = this.props
    return (
      <Modal
        centered
        destroyOnClose={true}
        title={<div style={{ width: '100%', textAlign: 'center', fontWeight: 600 }}>{title}</div>}
        visible={visible}
        onCancel={onCancel}
        width={width || 800}
        footer={
          footer ?
            footer
            : <div onClick={onOk} className='dialog-footer-button'>
            <div>确 认</div>
          </div>
        }
      >
        {children}
      </Modal>
    );
  }
}

export default CashierModal;